package com.lhn.controller;

import com.lhn.entity.Type;
import com.lhn.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author lhn
 * @date 2024-10-10 22:02
 */

@RestController
@RequestMapping("type")
public class TypeController {
    @Autowired
    private TypeService typeService;

    @GetMapping("findAllType")
    public List<Type> findAllType() {
        return typeService.findAllType();
    }

    @PostMapping ("findById/{id}")
    public Type findById(@PathVariable("id") long id) {
        return typeService.findById(id);
    }
}
